package com.example.friend.controller;

import com.example.core.controller.BaseController;
import com.example.core.domain.R;
import com.example.file.domain.OSSResult;
import com.example.friend.service.IFileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/file")
public class FileController extends BaseController {

    @Autowired
    private IFileService FileService;

    @PostMapping("/upload")
    public R<?> upload(@RequestBody MultipartFile file) {
        return R.ok(FileService.upload(file));
    }
}
